package com.zifeng.study.springbootshirojwtdemo.mapper;

import com.zifeng.study.springbootshirojwtdemo.bean.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @author: 吴梓锋
 * @date: 2022/01/14 15:41:02
 * @version: 1.0.0
 * @description: userMapper
 */
@Mapper
public interface UserMapper {

    /**
     * 根据userId获取该用户的角色
     *
     * @param userId userId
     * @return 用户实体类
     */
    @Select("select * from user where id = #{userId}")
    User getUserByUserId(int userId);

    /**
     * 根据userName获取该用户的角色
     *
     * @param userName userId
     * @return 用户实体类
     */
    @Select("select * from user where user_name = #{userName}")
    User getUserByUserName(String userName);

}
